package com.jp.fm.data;

import org.apache.commons.lang3.builder.ToStringBuilder;

public class Category implements Comparable<Category> {

	private Integer id = null;
	private String name = null;

	public Category(final Integer id, final String name) {
		super();
		this.id = id;
		this.name = name;
	}

	@Override
	public final boolean equals(final Object obj) {

		boolean ret = false;
		if (obj instanceof Category) {
			ret = this.getName().equals(((Category) obj).getName());
		}
		return ret;
	}

	@Override
	public final int hashCode() {
		return super.hashCode();
	}

	public final Integer getId() {
		return this.id;
	}

	public final void setId(final Integer id) {
		this.id = id;
	}

	public final String getName() {
		return this.name;
	}

	public final void setName(final String name) {
		this.name = name;
	}

	public final String toString() {
		return ToStringBuilder.reflectionToString(this).toString();
	}

	@Override
	public final int compareTo(final Category o) {

		return this.getName().compareTo(o.getName());
	}
}
